from django.urls import path
# ==== 引入views 文件 =======
from userweb.views import account as account_views
from userweb.views import login as login_views
from userweb.views import resetpass as resetpass_views
from userweb.views import roles as roles_views
from userweb.views import menu as menu_views
from userweb.views import permission as permission_views

urlpatterns = [

    # ================ 登陆账号 ========================
    path('account/', account_views.index, name="account"),
    path('account/list/', account_views.list_values, name="list_account"),
    path('account/add/', account_views.add_value, name="add_account"),
    path('account/edit/', account_views.edit_value, name="edit_account"),
    path('account/del/', account_views.del_value, name="del_account"),
    path('account/ch/pwd/', account_views.change_pwd, name="change_account_pwd"),
    path('account/ch/status/', account_views.change_account_status, name="change_account_status"),

    # ============== 登陆 ===============================
    path('login/', login_views.index, name="login"),
    path('login/handle/', login_views.login_handle, name="login_handle"),

    # =============== 角色 =====================================
    path("roles/", roles_views.index, name="roles"),
    path("roles/list/", roles_views.list_values, name="list_roles"),
    path("roles/add/", roles_views.add_value, name="add_roles"),
    path("roles/edit/", roles_views.edit_value, name="edit_roles"),
    path("roles/del/", roles_views.del_value, name="del_roles"),
    path('roles/all/select/', roles_views.get_roles_select, name="roles_all_select"),
    path('roles/permission/update/', roles_views.update_permission, name="role_update_permission"),
    path('roles/permission/list/', roles_views.list_role_permission, name="role_list_permission"),

    # =============== 重置密码 ==================================
    path('reset/pass/', resetpass_views.index, name="reset_pass"),
    path('reset/pass/get_account/', resetpass_views.get_account_info, name="reset_account_info"),
    path('reset/pass/send_email/', resetpass_views.send_email, name="reset_send_email"),
    path('reset/pass/check_code/', resetpass_views.check_email_code, name="reset_check_code"),
    path('reset/pass/commit/', resetpass_views.change_pwd, name="reset_pass_commit"),


    # ================ 菜单管理 ============================
    path('menu/', menu_views.index, name="menu"),
    path('menu/list/', menu_views.list_values, name="list_menu"),
    path('menu/add/', menu_views.add_value, name="add_menu"),
    path('menu/edit/', menu_views.edit_value, name="edit_menu"),
    path('menu/del/', menu_views.del_value, name="del_menu"),
    path('menu/all/select/', menu_views.get_all_select, name="menu_all_select"),

    # ================ 权限管理 =============================
    path('permission/', permission_views.index, name="permission"),
    path('permission/list/', permission_views.list_values, name="list_permission"),
    path('permission/get_by_id/', permission_views.get_permission_by_id, name="permission_get_by_id"),
    path('permission/add/', permission_views.add_value, name="add_permission"),
    path('permission/edit/', permission_views.edit_value, name="edit_permission"),
    path('permission/del/', permission_views.del_value, name="del_permission"),

]
